
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8"%>
<%@include file="/lib/common/basedir.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery hover图片遮罩层滑动</title>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
	list-style-type: none;
} /*清楚内外默认边距*/


ul li {
	width: 297px;
	height: 198px;
	float: left;
	margin-right: 15px;
	margin-bottom: 15px;
	position: relative;
	overflow: hidden;
	cursor: pointer;
}

.txt {
	width: 297px;
	height: 45px;
	background: rgba(0, 0, 0, 0.6); /*透明背景色，不透明其文字内容*/
	position: absolute;
	left: 0;
	bottom: 0;
	color: #fff;
	font-family: "微软雅黑";
}

.txt h3 {
	font-size: 20px;
	font-weight: 100;
	height: 45px;
	text-align: center;
	line-height: 45px;
}

.txt p {
	font-size: 14px;
	text-align: center;
}
</style>
</head>
<body>
			<ul>
				<li><img src="http://localhost:8080/DessertHouse/img/1.jpg" />
					<div class="txt">
						<h3>IT培训</h3>
						<p>为您铺就成为IT大神的在线学习之路</p>
					</div></li>
			</ul>



	<script type="text/javascript" src="http://localhost:8080/DessertHouse/lib/js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">
		$("ul li").hover(function() {
			$(this).find(".txt").stop().animate({
				height : "198px"
			}, 400);
			$(this).find(".txt h3").stop().animate({
				paddingTop : "60px"
			}, 400);
		}, function() {
			$(this).find(".txt").stop().animate({
				height : "45px"
			}, 400);
			$(this).find(".txt h3").stop().animate({
				paddingTop : "0px"
			}, 400);
		})
	</script>
</body>
</html>

